package test.designmode.listener;

public class EventSource2 implements IEvent {  
    private IEventListener ml;  
    private boolean button;
    private boolean mouse;
  
    @Override  
    public void setEventListener(IEventListener arg) {  
        ml = arg;  
    }  
  
    @Override  
    public boolean clickButton() {  
        return button;
    }  
  
    @Override  
    public boolean moveMouse() {  
        return mouse;
    }  
  
    // 触发事件  
    public void buttonEventHappened() {  
        button = true;  
        ml.doEvent(this);  
    }  
  
}  